{
package Base;

sub new {
    bless({a => 1}, $_[0]);
}

}

{
package Derived;

use base qw(Base);

}

my $num = 0;
for (0 .. (1000000-1)) {
    my $obj = Derived->new();
    $num += $obj->{a};
}

print "$num\n";
